import {MENU} from "../types";

export const SetGlobalLoadingActions = (dispatch: any, loading: boolean) => async () => {
    window.loadingTimer = setTimeout(() => {
        dispatch({type: MENU.LOADING, payload: false}); // 最多5秒钟就让loading重置掉
        clearTimeout(window.loadingTimer);
    }, 5000);
    dispatch({type: MENU.LOADING, payload: loading});
}
